﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Rapid
{
    static class TestResults
    {
        public static void Reset()
        {
            isMonitoring = false;

            foreach (var result in DicResults)
                result.Value.observation = EObservation.Line;

            foreach (var result in DicCommonResults)
                result.Value.observation = EObservationCommon.Normal;
        }

        public static bool isMonitoring = false;

        public static Dictionary<ETest, Test> DicResults = new Dictionary<ETest, Test>()
            {
                {ETest.BAR, new Test(ETest.BAR, EObservation.Line)},
                {ETest.BZO, new Test(ETest.BZO, EObservation.Line)},

                {ETest.THC, new Test(ETest.THC, EObservation.Line)},
                {ETest.COC, new Test(ETest.COC, EObservation.Line)},

                {ETest.OPI, new Test(ETest.OPI, EObservation.Line)},
                {ETest.MET, new Test(ETest.MET, EObservation.Line)},

                {ETest.TCA, new Test(ETest.TCA, EObservation.Line)},
                {ETest.MTD, new Test(ETest.MTD, EObservation.Line)},

                {ETest.MDMA, new Test(ETest.MDMA, EObservation.Line)},
                {ETest.OXY, new Test(ETest.OXY, EObservation.Line)},

                {ETest.AMP, new Test(ETest.AMP, EObservation.Line)},
                {ETest.PCP, new Test(ETest.PCP, EObservation.Line)},


                // for c1->c6
                {ETest.ControlC1, new Test(ETest.ControlC1, EObservation.Line)},
                {ETest.ControlC2, new Test(ETest.ControlC2, EObservation.Line)},
                {ETest.ControlC3, new Test(ETest.ControlC3, EObservation.Line)},
                {ETest.ControlC4, new Test(ETest.ControlC4, EObservation.Line)},
                {ETest.ControlC5, new Test(ETest.ControlC5, EObservation.Line)},
                {ETest.ControlC6, new Test(ETest.ControlC6, EObservation.Line)}

            };

        public static Dictionary<ETest, Test> DicResultsShort()
        {
            return DicResults.Take(12).ToDictionary(v => v.Key, v => v.Value);
        }

        public static Dictionary<ETestCommon, TestCommon> DicCommonResults = new Dictionary<ETestCommon, TestCommon>()
            {
                {ETestCommon.Cr, new TestCommon(ETestCommon.Cr, EObservationCommon.Normal)},
                {ETestCommon.Ni, new TestCommon(ETestCommon.Ni, EObservationCommon.Normal)},

                {ETestCommon.pH, new TestCommon(ETestCommon.pH, EObservationCommon.Normal)},
                {ETestCommon.Bl, new TestCommon(ETestCommon.Bl, EObservationCommon.Normal)},
                
                {ETestCommon.SG, new TestCommon(ETestCommon.SG, EObservationCommon.Normal)}
            };
    }
}
